home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / blix / blixvect.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.2 KB  |  95 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*_________________________________________________________________________
  18.  |
  19.  | blixvect.h - functions to support operations on vectors and matrices.
  20.  |
  21.  | Lots of original code from David Ciemiewicz, Mark Grossman, Henry Moreton,
  22.  | Paul Haeberli, and Gavin Bell.
  23.  |
  24.  | Frans van Hoesel added more specific prototypes, inline pragma's,
  25.  | and some functions (not all of them are tested)
  26.  |
  27. */
  28.  
  29. #ifndef VECT_H_SEEN
  30. #define VECT_H_SEEN
  31.  
  32. #include <math.h>
  33. #include <gl/gl.h>
  34.  
  35.  
  36. /* definitions of coordinate indices */
  37. #define X 0
  38. #define Y 1
  39. #define Z 2
  40. #define W 3
  41. #define THETA 0
  42. #define PHI 1
  43. #define R 2
  44.  
  45. void    frompolar(const float p[2], float v[3]);
  46. void    frompolar3(const float p[3], float v[3]);
  47. void    topolar(const float v[3], float p[2]);
  48. void    topolar3(const float v[3], float p[3]);
  49. float    vdistance(const float v1[3], const float v2[3]);
  50. float    vdistance2(const float v1[3], const float v2[3]);
  51. float    vdistance_angle(const float p1[2], const float p2[2]);
  52. float     *vnew(void);
  53. float     *vclone(const float [3]);
  54. void     vcopy(const float [3] , float [3]);
  55. void     vprint(const float [3]);
  56. void     vset(float [3], const float, const float, const float);
  57. void     vzero(float [3]);
  58. void     vnormal(float [3]);
  59. void    vnormal2(const float v[3], float dst[3]) ;
  60. float     vlength(const float [3]);
  61. void     vscalar(float [3], const float);
  62. void     vmult(const float [3], const float [3], float [3]);
  63. void     vadd(const float [3], const float [3], float [3]);
  64. void     vsub(const float [3], const float [3], float [3]);
  65. void     vhalf(const float [3], const float [3], float [3]);
  66. float     vdot(const float [3], const float [3]);
  67. int    veq(const float [3], const float [3]);
  68. void     vcross(const float [3], const float [3], float [3]);
  69. void    vdirection(const float v1[3], const float v2[3], float dir[3]);
  70. void     vreflect(const float [3], const float [3], float [3]);
  71. void     vtransform(const float [3], const Matrix, float [3]);
  72. void     vtransform4(const float [4], const Matrix, float [4]);
  73. void    vrot_axis(const float v1[3], const float a[3], const float alpha,
  74.                 float v2[3]);
  75.  
  76.  
  77. extern     Matrix idmatrix;
  78. extern  float x_axis[];
  79. extern  float y_axis[];
  80. extern  float z_axis[];
  81.  
  82. void     mcopy(const Matrix, Matrix);
  83. void     minvert(const Matrix, Matrix);
  84. void    mprint(const Matrix);
  85. void     mmultmatrix(const Matrix, const Matrix, Matrix);
  86. void     mgetmatrix(Matrix);
  87. void    mmakerot(const float *, const float *, Matrix);
  88. void    mbuild_polar_rot(const float [2], Matrix);
  89. void    mmake_rot_axis(const float [3], const float, Matrix);
  90.  
  91. void     linsolve(const float *[], int, float *);
  92.  
  93. #endif     /* VECT_H_SEEN */
  94.  
  95.